﻿@{
    ViewData["Title"] = "主页";
}


@*<div class="text-center">
        <div class="row">
            <div class="span4">...</div>
            <div class="span8">...</div>
        </div>
        <h1 class="display-4">Welcome</h1>
        <p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
    </div>*@



<div class="container">
    <div class="py-5 text-center">
        <h2>语文字帖制作工具</h2>
        <p class="lead">用于制作五缘实验学校的学生字帖。<br />本工具仅用于学习目的。</p>
    </div>

    <div class="row">
        <div class="col-md-8 order-md-1">
            @*<form class="needs-validation" novalidate="" _lpchecked="1">*@
            <div class="row">

            </div>

            @*<div class="row">
                    <div class="col-md-4 mb-3">
                        <label for="cc-number">课文号码</label>
                        <input type="text" class="form-control" id="num" placeholder="示例：15" required>
                        <small class="text-muted">课文的数字编号</small>
                    </div>
                    <div class="col-md-3 mb-3">
                        <label for="title">课文名称</label>
                        <input type="text" class="form-control" id="title" placeholder="示例：搭船的鸟" required>
                        <small class="text-muted">课文的中文名称</small>
                    </div>
                </div>*@

            <div class="row">
                <div class="col-md-12 mb-3">
                    <label for="country">年级</label>
                    <select class="custom-select d-block w-100" id="grade" required>
                        <option value="2">二年级生字字帖</option>
                        <option value="3">三年级生字字帖</option>
                        <option value="4">四年级生字字帖</option>
                        <option value="5">五年级生字字帖</option>
                        <option value="6">六年级生字字帖</option>
                    </select>
                    <small class="text-muted">字帖右上角关于年级的文字</small>
                </div>

                <div class="col-md-6 mb-3">
                    <label for="cc-number">课文号码</label>
                    <input type="text" class="form-control" id="num" placeholder="示例：15" required>
                    <small class="text-muted">课文的数字编号</small>
                </div>
                <div class="col-md-6 mb-3">
                    <label for="title">课文名称</label>
                    <input type="text" class="form-control" id="title" placeholder="示例：搭船的鸟" required>
                    <small class="text-muted">课文的中文名称</small>
                </div>
            </div>

            <div class="mb-3">
                <label for="address">字帖内容</label>
                <input type="text" class="form-control" id="context" placeholder="示例：搭亲父沙啦响羽翠嘴悄吞哦捕" required>
                <small class="text-muted">字帖中的每个字</small>
            </div>
            <hr class="mb-4">
            <button class="btn btn-primary btn-lg btn-block" type="submit" onclick="Makeimage()">制作图片</button>
            <button class="btn btn-primary btn-lg btn-block" type="submit" onclick="MakeDoc()">制作文档</button>

            @*</form>*@
        </div>
    </div>
    <script type="text/javascript">
        function Makeimage() {
            var c = $("#context")[0].value;
            var t = $("#title")[0].value;
            var n = $("#num")[0].value;
            var g = $("#grade").val();
            window.location.href = "Home/GetImage?no=" + n + "&title=" + t + "&context=" + c + "&grade=" + g;
        }
        function MakeDoc() {
            var c = $("#context")[0].value;
            var t = $("#title")[0].value;
            var n = $("#num")[0].value;
            var g = $("#grade").val();
            htmlobj = $.ajax({ url: "Home/GetDoc?no=" + n + "&title=" + t + "&context=" + c + "&grade=" + g, async: false });
            window.location.href = htmlobj.responseText;
        }
    </script>
</div>
